const app = getApp(), myreg = /^1[34578]\d{9}$/;
Page({
    data: {
        inputPhone: '',
        inputCode: '',
        yzmnone: false,
        countdown: '发送验证码',
    },
    onLoad() { },
    /*input*/
    passinput1(e) {
        this.setData({
            inputPass1: e.detail.value
        })
    },
    passinput2(e) {
        this.setData({
            inputPass2: e.detail.value
        })
    },
    passinput3(e) {
        this.setData({
            inputPass3: e.detail.value
        })
    },
    /*绑定*/
    SignIn() {
        if (this.data.inputPass2 == this.data.inputPass3){
            this.SignInAjax();
        }else{
            app.util.showModal(false, '提示','两次密码不相同')
        }
    },
    SignInAjax() {
        app.request.request({
            link: '/api/supplier/editpassword',
            methodtype: 'POST',
            ting: {
                old_password: this.data.inputPass1,
                new_password: this.data.inputPass3,
            },
            succ: (res) => {
                let Boxs = res.data.data, BoxMeta = res.data.message;
                if (res.data.status == 200) {
                    app.util.Success('修改成功', () => {
                        setTimeout(() => {
                            wx.navigateBack({
                                delta: 1
                            })
                        }, 1500)
                    });
                } else {
                    app.util.showModal(false, '提示', BoxMeta)
                }
            },
            fail: (err) => {
                app.util.showModal(false, '网络错误', '请检查网络，重新登录')
            }
        })
    },
})